﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="BookingTicket.aspx.cs" Inherits="BookingTicket" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <link href="Style/StyleSheet.css" type="text/css" rel="Stylesheet" />
   <script type="text/javascript" src="Scripts/WdatePicker.js"></script>
   <link rel="Stylesheet" rev="Stylesheet" href="Scripts/jock-citypicker-2.0.min.css" type="text/css" />
    <script type="text/javascript" src="Scripts/jock-citypicker-2.0.min.js"></script>
    <script type="text/javascript">
        $(function () {
            showCont();
            $("input[name=TicketType]").click(function () {
                showCont();
            });
        });
        function showCont() {
            switch ($("input[name=TicketType]:checked").attr("id")) {
                case "dc":
                    $("#From_time").show();
                    $("#To_timeLabel").hide();
                    $("#To_time").hide();
                    break;
                case "wf":
                    $("#From_time").show();
                    $("#To_timeLabel").show();
                    $("#To_time").show();
                    break;
                default:
                    break;
            }
        }
    </script>
   <script type="text/javascript">
       window.onload = function () {
           var a = document.getElementById("From_station");
           var b = document.getElementById("To_station");

           a.onclick = function () {
               citypicker.show({ left: 80, top: 20 }, function (data) {
                   a.value = data;
               });
           };

           var p = { left: 323, top: 20 };
           var fn1 = function (city) {
               b.value = city;
           };
           b.onclick = function () {
               citypicker.bind(fn1).fix(p).show();
           };
       }
    </script>
</head>
<body>
    <form id="form1" runat="server" method="post">
    <div class="MainConten"  
        style="width:1200px; height:1200px; margin:0 auto 108px auto;">
            <h1 style="text-align:center; color: Lime">飞机票订购</h1>
            <div class="Menu" style=" width:100%; height:80px">
                <div class="TicketType" style="width:100%; height:40px">
                    <table border="0" cellspacing="0" cellpadding="0" width="40%">
                    	<tr>
                    		<td>
                                <input type="radio" name="TicketType" id="dc" checked="checked" style="cursor:pointer" />
                                <asp:label runat="Server">单程</asp:label>
                            </td>
                            <td>
                                <input type="radio" name="TicketType" id="wf"  style="cursor:pointer"/>
                                <asp:label ID="Label1" runat="Server">往返</asp:label>
                            </td>
                            <td>
                                <a href="LianChengBookingTicket.aspx"  shape="rect" style="color:Lime;">联程</a>
                            </td>
                    	</tr>
                    </table>
                </div>
                <div class="MenuItem" style="width:100%; height:40px; ">
                        <table border="0" cellspacing="0" cellpadding="0" width="100%" 
                            style="height: 30px" >
                        	<tr>
                        		<td>
                                     <asp:label id="From_stationLabel" runat="server"  class="LabelStyle"  style="height:100%; margin-bottom:10px">出发地:</asp:label>
                                    
                                </td>
                                <td>
                                    <asp:TextBox id="From_station" class="txtBox" style="float:left; width: 140px;" name="Fromstation"  runat="Server"></asp:TextBox>
                                </td>
                                <td>
                                    <asp:label id="To_stationLabel" runat="server"  class="LabelStyle" >目的地:</asp:label>
                                    
                                </td>
                                <td>
                                    <asp:TextBox id="To_station" class="txtBox"  style="float:left"  runat="Server"></asp:TextBox>
                                </td>
                                <td>
                                    <asp:label id="From_timeLabel" runat="server"  class="LabelStyle" >出发时间:</asp:label>
                                </td>
                                <td>
                                    <asp:TextBox runat="Server" id="From_time" value="2015-06-06" class="txtBox" onclick="WdatePicker({dateFmt:'yyyy-MM-dd'})"  style="float:left" ></asp:TextBox>
                                </td>
                                <td>
                                    <asp:label id="To_timeLabel" runat="server"  class="LabelStyle" >到达时间:</asp:label>
                                </td>
                                <td>
                                    <input type="TextBox" id="To_time" value="2015-06-06" class="txtBox" onclick="WdatePicker({dateFmt:'yyyy-MM-dd'})" readonly="readonly" style="float:left" />
                                </td>
                                <td>
                                    <asp:Button runat="Server" class="ButtonStyle" Text="查询" 
                                        id="SearchTicket" onclick="SearchTicket_Click" ></asp:Button>
                                </td>
                        	</tr>
                        </table>                    
                </div>
            </div>
            <div style="margin:0 42px 0 auto; width:1200px">
                <asp:GridView ID="GridView_lookup" runat="Server" 
                    AutoGenerateColumns="false" CellPadding="2" ForeColor="#333333" 
                    GridLines="None" BorderStyle="Ridge" 
                    OnPageIndexChanging="GridView_lookup_PageIndexChanging" PageSize="15" 
                    Height="100%" 
                    onselectedindexchanging="GridView_lookup_SelectedIndexChanging" 
                    onselectedindexchanged="GridView_lookup_SelectedIndexChanged" 
                    style="margin-right: 155px" onrowcommand="GridView_lookup_RowCommand">
                    <FooterStyle BackColor="#990000" Font-Bold="true" ForeColor="White" />
                    <Columns>            
                          <asp:TemplateField HeaderText="航班编号">
                    <EditItemTemplate>
                        &nbsp;<asp:Label ID="Label3" runat="server" Text='<%# Eval("FlightID") %>'></asp:Label>
                    </EditItemTemplate>
                    <ItemTemplate>
                        <asp:Label ID="Label0" runat="server" Text='<%# Bind("FlightID") %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                          <asp:TemplateField HeaderText="航班号">
                    <EditItemTemplate>
                        <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("FlightNumber") %>'></asp:TextBox>
                    </EditItemTemplate>
                    <ItemTemplate>
                        <asp:Label ID="Label1" runat="server" Text='<%# Bind("FlightNumber") %>'></asp:Label>
                    </ItemTemplate>              
                </asp:TemplateField>
                          <asp:TemplateField HeaderText="飞机型号">
                    <EditItemTemplate>
                        <asp:TextBox ID="TextBox2" runat="server" Text='<%# Bind("FlightType") %>'></asp:TextBox>
                    </EditItemTemplate>
                    <ItemTemplate>
                        <asp:Label ID="Label2" runat="server" Text='<%# Bind("FlightType") %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                          <asp:TemplateField HeaderText="头等舱">
                    <EditItemTemplate>
                        <asp:TextBox ID="TextBox4" runat="server" Text='<%# Bind("FirstSeat") %>'></asp:TextBox>
                    </EditItemTemplate>
                    <ItemTemplate>
                        <asp:Label ID="Label4" runat="server" Text='<%# Bind("FirstSeat") %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                          <asp:TemplateField HeaderText="头等舱票价 ">
                    <EditItemTemplate>
                        <asp:TextBox ID="TextBox5" runat="server" Text='<%# Bind("FirstSeatPrice") %>'></asp:TextBox>
                    </EditItemTemplate>
                    <ItemTemplate>
                        <asp:Label ID="Label5" runat="server" Text='<%# Bind("FirstSeatPrice") %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                          <asp:TemplateField HeaderText="商务舱">
                    <EditItemTemplate>
                        <asp:TextBox ID="TextBox6" runat="server" Text='<%# Bind("BusinessSeat") %>'></asp:TextBox>
                    </EditItemTemplate>
                    <ItemTemplate>
                        <asp:Label ID="Label6" runat="server" Text='<%# Bind("BusinessSeat") %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                          <asp:TemplateField HeaderText="商务舱票价">
                    <EditItemTemplate>
                        <asp:TextBox ID="TextBox7" runat="server" Text='<%# Bind("BusinessSeatPrice") %>'></asp:TextBox>
                    </EditItemTemplate>
                    <ItemTemplate>
                        <asp:Label ID="Label7" runat="server" Text='<%# Bind("BusinessSeatPrice") %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                          <asp:TemplateField HeaderText="经济舱">
                    <EditItemTemplate>
                        <asp:TextBox ID="TextBox8" runat="server" Text='<%# Bind("EconomicSeat") %>'></asp:TextBox>
                    </EditItemTemplate>
                    <ItemTemplate>
                        <asp:Label ID="Label8" runat="server" Text='<%# Bind("EconomicSeat") %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                          <asp:TemplateField HeaderText="经济舱票价">
                    <EditItemTemplate>
                        <asp:TextBox ID="TextBox9" runat="server" Text='<%# Bind("EconomicSeatPrice") %>'></asp:TextBox>
                    </EditItemTemplate>
                    <ItemTemplate>
                        <asp:Label ID="Label9" runat="server" Text='<%# Bind("EconomicSeatPrice") %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                          <asp:TemplateField HeaderText="出发地">
                    <EditItemTemplate>
                        <asp:TextBox ID="TextBox10" runat="server" Text='<%# Bind("FromAddress") %>'></asp:TextBox>
                    </EditItemTemplate>
                    <ItemTemplate>
                        <asp:Label ID="Label10" runat="server" Text='<%# Bind("FromAddress") %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                          <asp:TemplateField HeaderText="目的地">
                    <EditItemTemplate>
                        <asp:TextBox ID="TextBox11" runat="server" Text='<%# Bind("ToAddress") %>'></asp:TextBox>
                    </EditItemTemplate>
                    <ItemTemplate>
                        <asp:Label ID="Label11" runat="server" Text='<%# Bind("ToAddress") %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                          <asp:TemplateField HeaderText="出发时间">
                    <EditItemTemplate>
                        <asp:TextBox ID="TextBox12" runat="server" Text='<%# Bind("FromDate") %>'></asp:TextBox>
                    </EditItemTemplate>
                    <ItemTemplate>
                        <asp:Label ID="Label12" runat="server" Text='<%# Bind("FromDate") %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                          <asp:TemplateField HeaderText="到达时间 ">
                    <EditItemTemplate>
                        <asp:TextBox ID="TextBox13" runat="server" Text='<%# Bind("ToDate") %>'></asp:TextBox>
                    </EditItemTemplate>
                    <ItemTemplate>
                        <asp:Label ID="Label13" runat="server" Text='<%# Bind("ToDate") %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="出发时刻">
                    <EditItemTemplate>
                        <asp:TextBox ID="TextBox14" runat="server" Text='<%# Bind("FromTime") %>'></asp:TextBox>
                    </EditItemTemplate>
                    <ItemTemplate>
                        <asp:Label ID="Label14" runat="server" Text='<%# Bind("FromTime") %>'></asp:Label>
                    </ItemTemplate>              
                </asp:TemplateField>
                          <asp:TemplateField HeaderText="预定">
                            <ItemTemplate>
                                <asp:LinkButton id = "LinkButton1" runat="Server" CommandArgument='<%#Eval("FlightNumber") %>' CommandName="LinkButtonBooking" OnClick="LinkButton1_Click">预订</asp:LinkButton>
                            </ItemTemplate>     
                          </asp:TemplateField>
                    </Columns>
                    <RowStyle ForeColor="#000066" />
                    <SelectedRowStyle BackColor="#669999" Font-Bold="true" ForeColor="White" />
                    <PagerStyle BackColor="white" ForeColor="#0000066" HorizontalAlign="Left" />
                    <HeaderStyle BackColor="#006699" Font-Bold="true" ForeColor="White" />
                </asp:GridView>
            </div>
        </div>
    </form>
</body>
</html>
